package com.robot.orders.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * orders实体类
 *
 * @author wuyunbin
 */
@Entity
@Table(name = "orders")
public class Orders implements Serializable {
    /**
     * 订单id
     */
    @Id
    private String id;

    private String openId;
    /**
     * 外部交易号
     */
    private String transactionNo;
    /**
     * 支付方式 10=微信jsApi支付 11=微信APP支付 12=微信Native支付 13=微信刷脸支付 14=微信H5支付,20-支付宝扫码,30-银联,40-其他
     */
    private String payment;
    /**
     * 会员id
     */
    private String memberId;
    /**
     * 会员昵称
     */
    private String nickname;
    /**
     * 会员等级
     */
    private String memberGrade;
    /**
     * 会员手机号
     */
    private String phone;
    /**
     * 代理商id
     */
    private String agentId;
    /**
     * 商家id
     */
    private String companyId;

    /**
     * 店铺名称
     */
    private String storeName;
    /**
     * 商家/店铺所在区县
     */
    private String area;


    /**
     * 店铺id
     */
    private String storeId;


    /**
     * 小票金额
     */
    private BigDecimal price;
    /**
     * 折扣率
     */
    private Double rate;
    /**
     * 折扣金额
     */
    private BigDecimal discountAmount;
    /**
     * 实付金额
     */
    private BigDecimal payAmount;
    /**
     * 总收益
     */
    private BigDecimal totalRevenue;
    /**
     * 代理商收益
     */
    private BigDecimal agentRevenue;
    /**
     * 平台收益
     */
    private BigDecimal revenue;
    /**
     * 本金
     */
    private BigDecimal principal;
    /**
     * 会长提成
     */
    private BigDecimal royalty;
    /**
     * 状态 0-未支付 1-已支付 2-关闭订单
     */
    private String status;

    /**
     * 是否使用了优惠券 0-未使用 1-已使用
     */
    private String hasCoupon;
    /**
     * 优惠券id
     */
    private String couponId;
    /**
     * 使用码豆数量
     */
    private int beans;
    /**
     * 使用金豆数量
     */
    private int goldenBeans;
    /**
     * 地址id
     */
    private String addressId;
    /**
     * 备注
     */
    private String remark;
    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createdAt;
    /**
     * 最后更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updatedAt;
    /**
     * 删除时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deletedAt;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getOpenId() {
        return openId;
    }

    public void setOpenId(String openId) {
        this.openId = openId;
    }

    public String getTransactionNo() {
        return transactionNo;
    }

    public void setTransactionNo(String transactionNo) {
        this.transactionNo = transactionNo;
    }

    public String getPayment() {
        return payment;
    }

    public void setPayment(String payment) {
        this.payment = payment;
    }

    public String getMemberId() {
        return memberId;
    }

    public void setMemberId(String memberId) {
        this.memberId = memberId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getMemberGrade() {
        return memberGrade;
    }

    public void setMemberGrade(String memberGrade) {
        this.memberGrade = memberGrade;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getAgentId() {
        return agentId;
    }

    public void setAgentId(String agentId) {
        this.agentId = agentId;
    }

    public String getCompanyId() {
        return companyId;
    }

    public void setCompanyId(String companyId) {
        this.companyId = companyId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public BigDecimal getDiscountAmount() {
        return discountAmount;
    }

    public void setDiscountAmount(BigDecimal discountAmount) {
        this.discountAmount = discountAmount;
    }

    public BigDecimal getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(BigDecimal payAmount) {
        this.payAmount = payAmount;
    }

    public BigDecimal getTotalRevenue() {
        return totalRevenue;
    }

    public void setTotalRevenue(BigDecimal totalRevenue) {
        this.totalRevenue = totalRevenue;
    }

    public BigDecimal getAgentRevenue() {
        return agentRevenue;
    }

    public void setAgentRevenue(BigDecimal agentRevenue) {
        this.agentRevenue = agentRevenue;
    }

    public BigDecimal getRevenue() {
        return revenue;
    }

    public void setRevenue(BigDecimal revenue) {
        this.revenue = revenue;
    }

    public BigDecimal getPrincipal() {
        return principal;
    }

    public void setPrincipal(BigDecimal principal) {
        this.principal = principal;
    }

    public BigDecimal getRoyalty() {
        return royalty;
    }

    public void setRoyalty(BigDecimal royalty) {
        this.royalty = royalty;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getHasCoupon() {
        return hasCoupon;
    }

    public void setHasCoupon(String hasCoupon) {
        this.hasCoupon = hasCoupon;
    }

    public String getCouponId() {
        return couponId;
    }

    public void setCouponId(String couponId) {
        this.couponId = couponId;
    }

    public int getBeans() {
        return beans;
    }

    public void setBeans(int beans) {
        this.beans = beans;
    }

    public int getGoldenBeans() {
        return goldenBeans;
    }

    public void setGoldenBeans(int goldenBeans) {
        this.goldenBeans = goldenBeans;
    }

    public String getAddressId() {
        return addressId;
    }

    public void setAddressId(String addressId) {
        this.addressId = addressId;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    public LocalDateTime getDeletedAt() {
        return deletedAt;
    }

    public void setDeletedAt(LocalDateTime deletedAt) {
        this.deletedAt = deletedAt;
    }

    @Override
    public String toString() {
        return "Orders{" +
                "id='" + id + '\'' +
                ", openId='" + openId + '\'' +
                ", transactionNo='" + transactionNo + '\'' +
                ", payment='" + payment + '\'' +
                ", memberId='" + memberId + '\'' +
                ", nickname='" + nickname + '\'' +
                ", memberGrade='" + memberGrade + '\'' +
                ", phone='" + phone + '\'' +
                ", agentId='" + agentId + '\'' +
                ", companyId='" + companyId + '\'' +
                ", storeName='" + storeName + '\'' +
                ", area='" + area + '\'' +
                ", storeId='" + storeId + '\'' +
                ", price=" + price +
                ", rate=" + rate +
                ", discountAmount=" + discountAmount +
                ", payAmount=" + payAmount +
                ", totalRevenue=" + totalRevenue +
                ", agentRevenue=" + agentRevenue +
                ", revenue=" + revenue +
                ", principal=" + principal +
                ", royalty=" + royalty +
                ", status='" + status + '\'' +
                ", hasCoupon='" + hasCoupon + '\'' +
                ", couponId='" + couponId + '\'' +
                ", beans=" + beans +
                ", goldenBeans=" + goldenBeans +
                ", addressId='" + addressId + '\'' +
                ", remark='" + remark + '\'' +
                ", createdAt=" + createdAt +
                ", updatedAt=" + updatedAt +
                ", deletedAt=" + deletedAt +
                '}';
    }
}
